home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Rotate / Rotation3.sqe < prev    next >
Encoding:
Text File  |  2004-06-14  |  4.2 KB  |  147 lines

  1. ========== Description Part Begin ==========
  2. name = "Rotation3";
  3. description = "When a character rotates to a certain angle, the rotation of next character begins.";
  4. version = "1.00";
  5. bin = "rotation3.bin";
  6. ========== Description Part End ==========
  7.  
  8.  
  9. ========== Parameter Part Begin ==========
  10. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  11. $nFrameCount(EDIT,INT,3,3 3,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  12. $nSpeed(EDIT,INT,3,1 50,"Fading Speed","The speed of character fading.");
  13. $nRotationSpeed(EDIT,INT,10,1 360,"Rotating Speed","The speed of character rotating.");
  14. $nScaleSpeed(EDIT,INT,10,1 100,"Scaling Speed","To control the speed of character scaling.");
  15. $nInterval(EDIT,INT,8,1 1000,"Interval","The time difference between the former character and the latter one beginning to rotate.");
  16.  
  17. $bMode(LIST,INT,0,"False":0 "True":1,"Mode","False: rotating around the Y axis and scaling; True: rotating around the X axis and scaling");
  18.  
  19. ========== Parameter Part End ==========
  20.  
  21.  
  22. ========== Function Part Begin ==========
  23. nCharacterCount = 8;
  24. nFrameCount = 3;
  25. nSpeed = 3;
  26. nRotationSpeed = 10;
  27. nScaleSpeed = 10;
  28. nInterval = 40;
  29. bMode = 0;
  30.  
  31.  
  32. nCharacter_x = new Array(nCharacterCount);
  33. nCharacter_y = new Array(nCharacterCount);
  34. nCharacter_width = new Array(nCharacterCount);
  35. nCharacter_height = new Array(nCharacterCount);
  36.  
  37.  
  38. nIsRun = new Array(nCharacterCount);
  39. nWhoRun = 1;
  40. bkInterval = nInterval;
  41.  
  42. nOriginalSizeX = new Array(nCharacterCount);
  43. nOriginalSizeY = new Array(nCharacterCount);
  44.  
  45. for (i = 1; nCharacterCount >= i; i++)
  46. {
  47.     this["c" + i]._alpha = 100;
  48.     this["c" + i]._rotation = 0;
  49.     //this["c" + i]._xscale = 100;
  50.     //this["c" + i]._yscale = 100;
  51.     nOriginalSizeX[i - 1] = this["c" + i ]._xscale;
  52.     nOriginalSizeY[i - 1] = this["c" + i ]._yscale;
  53.     nCharacter_x[i - 1] = this["c" + i]._x;
  54.     nCharacter_y[i - 1] = this["c" + i]._y;
  55.  
  56.     nCharacter_width[i - 1] = this["c" + i]._width;
  57.     nCharacter_height[i - 1] = this["c" + i]._height;
  58.  
  59.     
  60.     nIsRun[i - 1] = true;
  61. }
  62.  
  63.  
  64. function fun()
  65. {
  66.     for (i = 1; nCharacterCount >= i && nWhoRun >= i; i++)
  67.     {
  68.         if (nIsRun[i - 1])
  69.         {
  70.             
  71.             if( bMode )
  72.             {
  73.                 this["c" + i]._xscale = this["c" + i]._xscale - nScaleSpeed;
  74.                 this["c" + i]._yscale = this["c" + i]._yscale + nScaleSpeed;
  75.             }
  76.             else
  77.             {
  78.             
  79.                  this["c" + i]._xscale = this["c" + i]._xscale + nScaleSpeed;
  80.                 this["c" + i]._yscale = this["c" + i]._yscale - nScaleSpeed;            
  81.             }
  82.             this["c" + i]._alpha = this["c" + i]._alpha - nSpeed;
  83.             this["c" + i]._rotation = this["c" + i]._rotation + nRotationSpeed;
  84.             
  85.             
  86.             
  87.             if (this["c" + i]._alpha < 0)
  88.             {
  89.                 nIsRun[i - 1] = false;
  90.                 restart(i);
  91.             } 
  92.         } 
  93.     } 
  94.     if (nWhoRun == nCharacterCount && this["c" + nCharacterCount]._xscale == 100)
  95.     {
  96.         nWhoRun = 1;
  97.         i = 1;
  98.         while (nCharacterCount >= i)
  99.         {
  100.             nIsRun[i - 1] = true;
  101.             i++;
  102.         }
  103.     } 
  104.     
  105.     
  106.     if (nInterval < 1)
  107.             {
  108.                 nInterval = bkInterval;
  109.                 nWhoRun++;
  110.                 if (nCharacterCount < nWhoRun)
  111.                 {
  112.                     nWhoRun = nCharacterCount;
  113.                 } 
  114.             } 
  115.     nInterval--;
  116.  
  117.  
  118.  
  119. function restart(nIndex)
  120. {
  121.     this["c" + nIndex]._x = nCharacter_x[nIndex - 1];
  122.     this["c" + nIndex]._y = nCharacter_y[nIndex - 1];
  123.     this["c" + nIndex]._width = nCharacter_width[nIndex - 1];
  124.     this["c" + nIndex]._height = nCharacter_height[nIndex - 1];
  125.     this["c" + nIndex]._alpha = 100;
  126.     this["c" + nIndex]._rotation = 0;
  127.     this["c" + i]._xscale = nOriginalSizeX[i - 1];
  128.     this["c" + i]._yscale = nOriginalSizeY[i - 1];
  129.  
  130. }
  131.  
  132.  
  133. function again()
  134. {
  135.     gotoAndPlay(2);
  136. }
  137.  
  138. ========== Function Part End ==========
  139.  
  140.  
  141. ========== Frame Part Begin ==========
  142. $frame(fun,1,-1,"fun");
  143. $frame(fun,2,-1,"fun");
  144. $frame(again,3,-1,"again");
  145. ========== Frame Part End ==========